<div id="tabcontainer">
    <ul>
       <li><a href="<?php echo base_url."index.php?mod=product&act=list"?>" >Sản phẩm</a></li>
       <li><a href="<?php echo base_url."index.php?mod=meterials&act=list"?>">Nguyên liệu</a></li>
       <li><a href="<?php echo base_url."index.php?mod=provider&act=list"?>">Nhà cung cấp</a></li>
    </ul>
</div>
<div id="tabsdetail">
    <div id="tab1" class="tabcontents">
      <div class="hd">
           <h2>danh sách nguyên liệu</h2>
           <div class="sub-form dm">
              <form action="<?php echo base_url."index.php?mod=meterials&act=search"; ?>" method="post">
                 <label>Tìm kiếm nguyên liệu <input type="text" name="key" placeholder="Nhập từ khóa tìm kiếm..." size="28" >
                      <button style="cursor: pointer;" name="ok" type="submit"><img src="public/images/search.png" alt=""></button>
                  </label>
              </form>
           </div>
           <div class="by">
               <div class="group-sp">
                    <h3>Nhóm nguyên liệu</h3>
                    <div class="list">
                      <ul>
                        <?php foreach($data['group'] as $item) { ?>
                          <li><a href="<?php echo base_url."index.php?mod=meterials&act=list&cid=".$item['manhomnguyenlieu'].""?>"><?php echo $item['tennhomnguyenlieu']?></a></li>
                        <?php } ?>
                          <li><a href="<?php echo base_url."index.php?mod=meterials&act=list"?>">Tổng Hợp</a></li>
                      </ul>  
                      <button><a href="<?php echo base_url."index.php?mod=meterials&act=group"?>"><img src="public/images/add.png" alt=""></a></button>
                    </div>
                </div>
               <table class="ds">
                   <thead>
                       <tr>
                           <th>Mã nguyên liệu</th>
                           <th>Tên nguyên liệu</th>
                           <th>Đơn vị tính</th>
                           <th>Đơn giá nhập</th>
                           <th>nhà cung câp</th>
                           <th>Action</th>
                       </tr>
                   </thead>
                   <tbody>
                   		
                      <?php if(isset($data['list']) && $data['list'] != NULL){ foreach($data['list'] as $pro) {?>
                       <tr class="tb1"> 
                           <td><?php echo $pro['manguyenlieu']?></td>
                           <td><?php echo $pro['tennguyenlieu']?></td>
                           <td><?php echo $pro['donvitinh']?></td>
                           <td><?php echo number_format($pro['dongia'])?> VNĐ</td>
                           <td><?php echo $pro['tennhacungcap']?></td>
                           <td>
                              <a href="<?php echo base_url."index.php?mod=meterials&act=edit&uid=".$pro['manguyenlieu'].""?>">Sửa</a>
                              <a href="<?php echo base_url."index.php?mod=meterials&act=delete&uid=".$pro['manguyenlieu'].""?>">Xóa</a>
                           </td>
                       </tr>
                      <?php } }?>
                   </tbody>
               </table>
               <div id="pagination"><?php echo $data['pagelist'];?></div>
           </div>
        </div>
        <ul class="add bh">
          <li><a href="<?php echo base_url."index.php?mod=meterials&act=add"?>">Thêm</a></li>
        </ul>
    </div>
</div>